﻿
using RBAC_Uthorization.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace RBAC_Uthorization.Read.API.DTO
{
    public class ResultResponseDto<T>
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool Success => Code == ResultCode.Ok;
        public ResultCode Code { get; set; }
        public string Massage { get; set; }
        //public string Token { get; set; }
        public T Data { get; set; }
        /// <summary>
        /// 操作成功
        /// </summary>
        public ResultResponseDto()
        {
            Code = ResultCode.Ok;
            Massage = "操作成功";
        }

        public ResultResponseDto(ResultCode code, string? errorinfo)
        {
            Code = code;
            Massage = errorinfo;
        }
    }
}
